package com.lehoon.tomato;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 *SpringBootServletInializer:外部tomcat需要继承这个类
 * 并覆盖configure方法
 *
 * @MapperScan 注解 扫描mapper的dao层
 */
@MapperScan("com.lehoon.tomato.mapper")
@SpringBootApplication
public class TomatoApiApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(TomatoApiApplication.class,args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(TomatoApiApplication.class);
    }
}
